﻿using System;

namespace ThresholdAssistant.Tools
{
    /// <summary>
    /// 随机数工具类
    /// </summary>
    public class RandomUtil
    {
        /// <summary>
        /// 随机因子
        /// </summary>
        private static Random rand => new Random((int)DateTime.Now.Ticks);

        /// <summary>
        /// 获取随机数
        /// </summary>
        /// <param name="nMinValue"></param>
        /// <param name="nMaxValue"></param>
        /// <param name="delayUnitTime"></param>
        /// <returns></returns>
        public static int GetDelayValue(int nMinValue, int nMaxValue, int delayUnitTime = 1000)
        {
            nMinValue = nMinValue * delayUnitTime;
            nMaxValue = nMaxValue * delayUnitTime;
            return rand.Next(nMinValue, nMaxValue);
        }
    }
}